package com.training.internal;
import java.util.Collection;

import com.training.capi.*;

import com.intershop.beehive.core.capi.common.ManagerImpl;
import com.intershop.beehive.core.capi.domain.Domain;
import com.intershop.beehive.core.capi.naming.NamingMgr;

public class BoxManagerPO extends ManagerImpl implements BoxManager
{
    private BoxPOFactory boxFactory;

    public BoxManagerPO()
    {
        boxFactory = (BoxPOFactory)NamingMgr.getInstance().lookupFactory(BoxPO.class);
    }

    public void removeBoxPO(String uuid)
    {
        if (uuid == null)
        {
            return;
        }

        boxFactory.remove(new BoxPOKey(uuid));
    }

    public Collection<? extends BoxPO> retrieveBox()
    {
        return boxFactory.getAllObjects();
    }

    @Override
    public BoxPO getBoxPO(String domainid)
    {
        BoxPOFactory fact = (BoxPOFactory)boxFactory.getObjectsByDomainID(domainid);
        return null;
    }

    @Override
    public void putBoxPO(Domain domain, String name)
    {
        boxFactory.create(domain, name);        
    }

}
